<template>
  <div>
    <Head :name="name"></Head>
    <van-cell-group>
  <van-field v-model="company" label="物流公司" placeholder="请输入物流公司" />
  <van-field v-model="haoma" label="快递单号" placeholder="请输入快递单号" />
  <van-field name="radio" label="投诉类型">
  <template #input>
    <van-radio-group v-model="radio" direction="horizontal" class="radio">
      <van-radio name="1" class="r">运输慢</van-radio>
      <van-radio name="2" class="r">物件损坏</van-radio>
      <van-radio name="3" class="r">物件丢失</van-radio>
      <van-radio name="4" class="r">疫情摆烂</van-radio>
    </van-radio-group>
  </template>
</van-field>
<van-field
  v-model="message"
  rows="2"
  autosize
  label="具体描述"
  type="textarea"
  maxlength="50"
  placeholder="如果是因为疫情摆烂你投诉也没用！！"
  show-word-limit
/>
</van-cell-group>
<div style="margin: 16px;" @click="up">
    <van-button round block type="info" native-type="submit">提交</van-button>
  </div>
  </div>
</template>
<script>
import  Head  from "./logisiticsview/headView.vue"
import {complain} from "./service"
export default{
  data(){
    return{
      radio: '1',
      company:'',
      haoma:'',
      message:'',
      name:'物流投诉'
    }
  },
  components:{
      Head,
  },
  methods:{
    async up(){
let res = await complain({ "companyId": 7, "infoNo": "ST0000001",
 "questionType": "1",
  "description": this.message 
  })
  console.log(res);
  this.$toast('提交成功');


  this.$router.push("/complainDetail")


  window.location.reload()
}
  }
  
}
</script>
<style lang="scss" scoped>
.radio{
  display: flex;
  flex-direction: column;
  .r {
    margin-bottom: 8px;
  }
}
</style>